Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: Basic support for future content and .await #18685

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

paldepind
Copy link
Contributor

@paldepind paldepind commented Feb 5, 2025

This PR takes a small step towards handling async Rust:

  • Adds a content type for things stored in the Future trait.
  • .await reads from the future content.

Notably this doesn't handle non-modeled calls to async functions.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Feb 5, 2025
@paldepind paldepind force-pushed the rust-future-content branch from 92b4a63 to 6e99087 Compare February 5, 2025 12:23
@paldepind paldepind marked this pull request as ready for review February 5, 2025 12:46
@Copilot Copilot bot review requested due to automatic review settings February 5, 2025 12:46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM.

@@ -203,6 +203,16 @@ fn test_apply_flow_through() {
sink(t); // $ hasValueFlow=33
}

async fn get_async_number(a: i64) -> i64 {
37
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a comment that this function has a summary model with taint through it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Done :)

geoffw0
geoffw0 previously approved these changes Feb 11, 2025
@paldepind
Copy link
Contributor Author

I had forgotten to update the .expected file after inserting the comment. CI is green now.

@paldepind paldepind requested a review from geoffw0 February 11, 2025 13:29
@paldepind paldepind merged commit 5a49390 into github:main Feb 11, 2025
16 checks passed
@paldepind paldepind deleted the rust-future-content branch February 11, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants